Skip to content

TYP: replace Label alias from pandas._typing with Hashable #39107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2021

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Jan 11, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone Jan 11, 2021
@jbrockmendel
Copy link
Member

LGTM

Label = Optional[Hashable]
IndexLabel = Union[Label, Sequence[Label]]
Level = Union[Label, int]
IndexLabel = Union[Hashable, Sequence[Hashable]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great i would add some comments here on when to use IndexLabel and that Hashable is a thing. (can be a followup)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a sperate PR since we may want to discuss renaming to IndexLabelArg for consistency. not thought it through thoroughly yet though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main reason for this is to have it clear to the maintainer which annotations we should be using where, for consistency.

@jreback jreback merged commit 46cec9f into pandas-dev:master Jan 11, 2021
@simonjayhawkins simonjayhawkins deleted the label-alias branch January 11, 2021 18:12
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the Label alias in pandas._typing.
3 participants